﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companyGPMAnalysisList.aspx.cs"
    Inherits="PeisongWeb.admin.companyGPMAnalysisList" %>

<%@ Register Assembly="OpenFlashChart" Namespace="OpenFlashChart" TagPrefix="cc1" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>企业毛利率分析 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script type="text/javascript">
        function resetFileds() {
            var c = document.getElementById("txtCompanyName");
            var y = document.getElementById("ddlYear");
            var m = document.getElementById('ddlMonth');
            var nowYear = (new Date()).getFullYear();
            c.value = "";
            m.value = "0";
            y.value = nowYear;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="ResourceManager1" />
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            企业毛利率分析
        </h2>
        <asp:UpdatePanel runat="server" ID="UpdatePanel1">
            <Triggers>
                <asp:PostBackTrigger ControlID="link_ExportToExcel" />
            </Triggers>
            <ContentTemplate>
                <ext:Panel ID="Panel1" runat="server" Title="企业毛利率分析" BodyStyle="padding:5px 5px 0"
                    Width="1120px" Frame="true" ButtonAlign="Center">
                    <Body>
                        <div id="admin_edit_content_search">
                            <ul>
                                <li style="width: 255px; margin-right: 5px;">
                                    <label style="width: 50px;">
                                        企业名称</label>
                                    <asp:TextBox Width="150px" runat="server" ID="txtCompanyName"></asp:TextBox>
                                </li>
                                <li style="width: 250px; margin-right: 5px;">
                                    <label style="width: 50px;">
                                        年/月</label>
                                    <asp:DropDownList runat="server" ID="ddlYear" Width="75px">
                                        <asp:ListItem Value="2009">2009</asp:ListItem>
                                        <asp:ListItem Value="2010" Selected="True">2010</asp:ListItem>
                                        <asp:ListItem Value="2011">2011</asp:ListItem>
                                        <asp:ListItem Value="2012">2012</asp:ListItem>
                                        <asp:ListItem Value="2013">2013</asp:ListItem>
                                        <asp:ListItem Value="2014">2014</asp:ListItem>
                                        <asp:ListItem Value="2015">2015</asp:ListItem>
                                    </asp:DropDownList>
                                    &nbsp;&nbsp;
                                    <asp:DropDownList runat="server" ID="ddlMonth">
                                        <asp:ListItem Value="0">-所有-</asp:ListItem>
                                        <asp:ListItem Value="1">1</asp:ListItem>
                                        <asp:ListItem Value="2">2</asp:ListItem>
                                        <asp:ListItem Value="3">3</asp:ListItem>
                                        <asp:ListItem Value="4">4</asp:ListItem>
                                        <asp:ListItem Value="5">5</asp:ListItem>
                                        <asp:ListItem Value="6">6</asp:ListItem>
                                        <asp:ListItem Value="7">7</asp:ListItem>
                                        <asp:ListItem Value="8">8</asp:ListItem>
                                        <asp:ListItem Value="9">9</asp:ListItem>
                                        <asp:ListItem Value="10">10</asp:ListItem>
                                        <asp:ListItem Value="11">11</asp:ListItem>
                                        <asp:ListItem Value="12">12</asp:ListItem>
                                    </asp:DropDownList>
                                </li>
                                <li>
                                    <label>
                                        &nbsp;</label>
                                    <asp:LinkButton runat="server" ID="link_Search" Text="[搜索]" OnClick="link_Search_Click"></asp:LinkButton>&nbsp;&nbsp;&nbsp;
                                    <a href="javascript:void(0)" onclick="resetFileds();">[重置]</a>&nbsp;&nbsp;&nbsp;
                                    <span style="<%=power>=2?"": "display:none" %>">
                                        <asp:LinkButton runat="server" ID="link_ExportToExcel" OnClick="link_ExportToExcel_Click">[导出Excel]</asp:LinkButton>
                                    </span></li>
                            </ul>
                        </div>
                    </Body>
                </ext:Panel>
                <p>
                    &nbsp;</p>
                <div id="admin_list_content" style="width: 1120px;">
                    <table cellpadding="0" cellspacing="0">
                        <tr class="header-row">
                            <th style="width: 25%;">
                                <asp:LinkButton runat="server" ToolTip="点击按企业创建时间排序" ID="linkOrderByCompany" Font-Underline="true"
                                    ForeColor="#105382" CommandName="t.companyId" OnCommand="link_Order_Comand">企业名称</asp:LinkButton>
                            </th>
                            <th style="width: 15%;">
                                <asp:LinkButton runat="server" ID="linkOrderByTotalIn" Font-Underline="true" ForeColor="#105382"
                                    CommandName="totalIn" OnCommand="link_Order_Comand">总进价</asp:LinkButton>
                            </th>
                            <th style="width: 15%;">
                                <asp:LinkButton runat="server" ID="linkOrderByTotalOut" Font-Underline="true" ForeColor="#105382"
                                    CommandName="totalOut" OnCommand="link_Order_Comand">总出价</asp:LinkButton>
                            </th>
                            <th style="width: 15%;">
                                <asp:LinkButton runat="server" ID="linkOrderByGPM" Font-Underline="true" ForeColor="#105382"
                                    CommandName="gpm" OnCommand="link_Order_Comand">毛利</asp:LinkButton>
                            </th>
                            <th style="width: 15%;">
                                <asp:LinkButton runat="server" ID="linkOrderByGPMRate" Font-Underline="true" ForeColor="#105382"
                                    CommandName="gpmrate" OnCommand="link_Order_Comand">毛利率</asp:LinkButton>
                            </th>
                            <th style="width: 15%;">
                                月详细信息
                            </th>
                        </tr>
                        <asp:Repeater ID="rpt_list" runat="server">
                            <ItemTemplate>
                                <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                                    <td>
                                        <a target="_blank" style="color: #666; text-decoration: underline;" href="companyGPMAnalysis.aspx?companyId=<%#DataBinder.Eval(Container.DataItem,"companyId") %>">
                                            <%#DataBinder.Eval(Container.DataItem,"companyName") %></a>
                                    </td>
                                    <td>
                                        <%#DataBinder.Eval(Container.DataItem,"totalIn","{0:F2}") %>
                                    </td>
                                    <td>
                                        <%#DataBinder.Eval(Container.DataItem,"totalOut","{0:F2}") %>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem,"gpm","{0:F2}")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem,"gpmRate","{0:P}")%>
                                    </td>
                                    <td>
                                        <a target="_blank" href="companyGPMAnalysis.aspx?companyId=<%#DataBinder.Eval(Container.DataItem,"companyId") %>">
                                            查看</a>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                    <div id="page">
                        <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                            OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="50"
                            InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                            ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                            CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                            LastPageText="末页" PrevPageText="上一页">
                        </webdiyer:AspNetPager>
                    </div>
                </div>
                <div id="admin_list_content" style="width: 1120px;">
                    <table cellpadding="0" cellspacing="0">
                        <tr class="header-row">
                            <th>
                                企业数量
                            </th>
                            <th>
                                总进价
                            </th>
                            <th>
                                总出价
                            </th>
                            <th>
                                总毛利
                            </th>
                            <th>
                                毛利率
                            </th>
                        </tr>
                        <asp:Repeater ID="rpt_rollup_list" runat="server">
                            <ItemTemplate>
                                <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                                    <td>
                                        <%#DataBinder.Eval(Container.DataItem,"totalCompany") %>
                                    </td>
                                    <td>
                                        <%#DataBinder.Eval(Container.DataItem,"totalIn","{0:F2}") %>
                                    </td>
                                    <td>
                                        <%#DataBinder.Eval(Container.DataItem,"totalOut","{0:F2}") %>
                                    </td>
                                    <td>
                                        <%#DataBinder.Eval(Container.DataItem,"gpm","{0:F2}") %>
                                    </td>
                                    <td>
                                        <%#DataBinder.Eval(Container.DataItem,"gpmRate","{0:F2}") %>%
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </div>
                <asp:HiddenField runat="server" ID="hdCurrentOrderBYColumn" />
                <asp:HiddenField runat="server" ID="hdCurrentOrderDirect" Value="ASC" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
